/**
 *Copyright (c) 2003, 2018, UMF and/or its affiliates. All rights reserved.
 */
package com.umf.b2b.model.order;

import com.umf.b2b.MerchantBaseRequest;
import com.umpay.dto.UMFResponse.Message;
import com.umpay.util.UMFUtil;

import java.util.List;

/**
<p>Title:ConsumeGenaralOrder</p>  
<p>Description: ��������</p>
 */
public class ConsumeGenaralOrder extends MerchantBaseRequest {

	private String notify_url;
	private String order_id;//*����ش���[��Ӧ����]���̻�ƽ̨�Լ����ɵĶ�����ţ���ʶ�ñʽ��׵�Ψһ��ţ�ÿ������ı�ű��벻һ����֧�����֡�Ӣ����ĸ���ʹ��
	private String mer_date;//*����ش���[��Ӧ����] �̻��������ڣ��̻�ƽ̨���ɶ��������ڣ�YYYYMMDD
	private String out_user_id;//�������Ҳ���������������̻�ע�ᣬ��˴���д���򷽵����̻����
	private String out_user_type;//���̻����ͣ���������out_user_id������ȷ�����ͣ�3����ҵ�̻�����2�����幤�̻�����1�������̻���
	private String order_type;//*����ش����������ͣ�2������������֧���ɹ���ƽ̨��Ҫ���ý�������ӿڣ����̻��Ľ����ſ������֣���3����׼������֧���ɹ���T+1�����̻��Ľ����Ϳ����֣�
	private String amount;//*����ش�������λ��
	private String order_channel;//*����ش�������������1��pc�̳� 2��app�̳� 3��h5�̳� 4���ֳ�����
	private String remark;//��ע��Ϣ
	private List<SplitCmd> split_cmd;//����ָ��,����������(order_type)Ϊ��������(2) ����׼����(3)ʱ�����ֶα��
	private String url = "/consume/genaralOrder";
	
	private String trade_no;//[��Ӧ����]

	@Override
	public String getRequestUrl() {
		return baseUrl + url;
	}

	@Override
	public ConsumeGenaralOrder doRequest() throws Exception {
		Message<ConsumeGenaralOrder> response = UMFUtil.post(createAPIContext(), this,ConsumeGenaralOrder.class);
		MerchantBaseRequest baseResult = convertResult(response, ConsumeGenaralOrder.class);
		if(baseResult == null)
			return null;
		return (ConsumeGenaralOrder)baseResult;
	}

	public String getMer_id() {
		return mer_id;
	}

	public void setMer_id(String mer_id) {
		this.mer_id = mer_id;
	}

	public String getOrder_id() {
		return order_id;
	}

	public void setOrder_id(String order_id) {
		this.order_id = order_id;
	}

	public String getMer_date() {
		return mer_date;
	}

	public void setMer_date(String mer_date) {
		this.mer_date = mer_date;
	}

	public String getNotify_url() {
		return notify_url;
	}

	public void setNotify_url(String notify_url) {
		this.notify_url = notify_url;
	}

	public String getTrade_no() {
		return trade_no;
	}

	public void setTrade_no(String trade_no) {
		this.trade_no = trade_no;
	}

	public String getOut_user_id() {
		return out_user_id;
	}

	public void setOut_user_id(String out_user_id) {
		this.out_user_id = out_user_id;
	}

	public String getOut_user_type() {
		return out_user_type;
	}

	public void setOut_user_type(String out_user_type) {
		this.out_user_type = out_user_type;
	}

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getOrder_type() {
		return order_type;
	}

	public void setOrder_type(String order_type) {
		this.order_type = order_type;
	}

	public String getOrder_channel() {
		return order_channel;
	}

	public void setOrder_channel(String order_channel) {
		this.order_channel = order_channel;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public List<SplitCmd> getSplit_cmd() {
		return split_cmd;
	}

	public void setSplit_cmd(List<SplitCmd> split_cmd) {
		this.split_cmd = split_cmd;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("ConsumeGenaralOrder [notify_url=");
		builder.append(notify_url);
		builder.append(", order_id=");
		builder.append(order_id);
		builder.append(", mer_date=");
		builder.append(mer_date);
		builder.append(", out_user_id=");
		builder.append(out_user_id);
		builder.append(", out_user_type=");
		builder.append(out_user_type);
		builder.append(", order_type=");
		builder.append(order_type);
		builder.append(", amount=");
		builder.append(amount);
		builder.append(", order_channel=");
		builder.append(order_channel);
		builder.append(", remark=");
		builder.append(remark);
		builder.append(", split_cmd=");
		builder.append(split_cmd);
		builder.append(", url=");
		builder.append(url);
		builder.append(", trade_no=");
		builder.append(trade_no);
		builder.append(", version=");
		builder.append(version);
		builder.append(", mer_id=");
		builder.append(mer_id);
		builder.append(", ret_code=");
		builder.append(ret_code);
		builder.append(", ret_msg=");
		builder.append(ret_msg);
		builder.append(", links=");
		builder.append(links);
		builder.append("]");
		return builder.toString();
	}

}
